﻿

#include "Test/TMap.h"


ATMap::ATMap()
{
	PrimaryActorTick.bCanEverTick = true;

	TestMap.Emplace(1, TEXT("A"));
	TestMap.Emplace(2, TEXT("B"));
	TestMap.Emplace(3, TEXT("C"));

}

void ATMap::BeginPlay()
{
	Super::BeginPlay();
	
}

void ATMap::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
}

void ATMap::PrintMap()
{

	for (auto& Elm : TestMap)
	{
		UE_LOG(LogTemp, Warning, TEXT("TestMap[%d] = %s"), Elm.Key, *Elm.Value)
	}

	UE_LOG(LogTemp, Warning, TEXT("---------------------"))
	FString* Value = TestMap.Find(2);
	auto Value2 = TestMap.Find(2)->GetCharArray().GetData();
	UE_LOG(LogTemp, Warning, TEXT("Find Result = %s|%s"), **Value, Value2);
	
}

